<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- 4、实现一个方法 uniq，传入一个已经排序好的整数数组，将重复元素删除掉并返回
uniq([1, 1, 2, 2, 3])    // [1, 2, 3] -->

<body>
    <div>test14-4</div>
    <script>
        function uniq(arr) {
            let newarr = Array.from(new Set(arr))
            return newarr.sort()
        }
        console.log(uniq([1, 1, 2, 2, 3]))
    </script>
</body>

</html>